#ifndef _REDISCONNECTOR_H_
#define _REDISCONNECTOR_H_

// #include <hiredis/hiredis.h>
#include "hiredis.h"
#include <string>
#include <mutex>
#include <vector>

#include "Json.h"
#include "singleton.hpp"


namespace dxy::easyWebServer
{

class RedisConnector
{
public:
    static RedisConnector & getInstance();

    void insert(const std::string & key, const std::string & value);
    void del(const std::string & key);
    std::string get(const std::string & key);
    std::vector<std::string> keys();


private:
    RedisConnector();
    ~RedisConnector();

private:
    std::string             m_ip        = "127.0.0.1";
    int                     m_port      = 6379; 
    std::string             m_passward  = "admin";
    std::mutex              m_mutex;

};

}


#endif